home *** CD-ROM | disk | FTP | other *** search
/ Maclife 129 / MACLIFE129.ISO.7z / MACLIFE129.ISO / mac / MACLIFE連載 / AppleScript / FaceSpan 3.0 Demo Installer.sit / FaceSpan 3.0 Demo Installer / FaceSpan 3.0 Demo / Optimizing Performance < prev    next >
Text File  |  1998-03-27  |  4KB  |  50 lines

  1. Optimizing FaceSpan 3.0 Performance
  2.  
  3. Introduction
  4.  
  5. This document describes how to use the new features of FaceSpan 3.0 to improve the performance of your FaceSpan projects.  The document explaining how FaceSpan 3.0 differs from previous releases and then goes on to give specific instructions on how to tune projects.
  6.  
  7. Background
  8.  
  9. FaceSpan 3.0 introduces a number of changes designed to enhance the performance of FaceSpan projects.  Some of these enhancements are automatic and others require you to upgrade your project.
  10.  
  11. In past FaceSpan releases, the best possible performance was obtained by moving as much of the projectユs AppleScript code as possible into the Project script.  This technique resulted in somewhat longer project launch times, but could reduce the time required to open a new window dramatically.  The downside was that project scripts quickly became very large and difficult to maintain.
  12.  
  13. FaceSpan 2.x would load all scripts associated with a window and all of the scripts associated with windows items before it displayed the window.  As the size of the window script and the number and size of window item scripts grow, the length of time before the window is presented lengthens.
  14.  
  15. In FaceSpan 3.0, the reverse is true.  FaceSpan 3.0 delays loading all scripts until they are actually required to respond to some sort of event, and as a result windows open very quickly regardless of the number and size of scripts associated with the window and its window items.  The only script which must be loaded right away is the project script.  By moving code out of the project script into window and window item scripts, project launch times can be reduced.
  16.  
  17. Performance Improvements
  18.  
  19. The following sections describe each of the performance improvements made in FaceSpan 3.0 and give instructions on how to tune your project for best performance.
  20.  
  21. Applet Launch Improvements
  22.  
  23. A major improvement in FaceSpan 3.0 is the speed with which project are launched.  In past releases there was a long delay when an applet was opened.  This delay was caused by the FaceSpan runtime environment as it initialized its self. 
  24.  
  25. With FaceSpan 3.0, this delay has been reduced dramatically.  The delay involved with launching a FaceSpan applet is now similar to that of launching a standard AppleScript applet.
  26.  
  27. For projects saved as Minature Applets these improvements are automatic when FaceSpan 3.0 is installed.  For projects saved as Complete Applets, you must open your applet in FaceSpan 3.0 and use the Save Project As command to upgrade your project.
  28.  
  29. Window Open Improvements
  30.  
  31. As described above windows open more quickly in FaceSpan because scripts associated with a window are loaded into memory only when needed.  In most cases, the script may not be loaded until some user event like a mouse click occurs.
  32.  
  33. Projects created with previous versions of FaceSpan must be upgraded to take full advantage of this performance enhancement.  To upgrade an older FaceSpan project, follow these steps:
  34.  
  35. 1)    Open the Project
  36.  
  37. 2) Open Each Window
  38.  
  39. Open each of your projectユs windows, make some modification such as moving an item up and then back down, and then close them.  By doing this, FaceSpan has the opportunity to examine your windowユs window script to determine if it has handlers for events which must be executed before presenting the window.  If these handlers (Open and Prepare) are absent, FaceSpan makes a note of this in your project so that it can ignore these events and delay loading the window script during window openings.
  40.  
  41. 3)    Repeat Step 2 for Every Window
  42.  
  43. 4)    Save Your Project
  44.  
  45. Window Item Improvements
  46.  
  47. Scripts associated with window items are no longer loaded when a window is opened.  Instead, they are only loaded when the window item receives some sort of event, like a mouse click.
  48.  
  49. You may notice a brief pause the first time you click on a window item as its script is loaded.  This delay will occur only once each time a window is displayed.
  50.